﻿using System.Xml;
using CarolLib.Configuration;
using CarolLib.WinService;

namespace MM.Configuration
{
    public class ServiceEntity
    {
        public ServiceEntity(XmlNode node)
        {
            XmlAttributeCollection atts = node.Attributes;
            this.ServiceName = ConfigurationBase.GetStringAttribute(atts, "name", string.Empty);
            this.ServiceDisPlayName = ConfigurationBase.GetStringAttribute(atts, "displayname", string.Empty);
            this.ServiceDescription = ConfigurationBase.GetStringAttribute(atts, "description", string.Empty);
            this.FileName = ConfigurationBase.GetStringAttribute(atts, "filename", string.Empty);
            this.Path = ConfigurationBase.GetStringAttribute(atts, "path", string.Empty);
        }

        public string ServiceName { get; set; }
        public string ServiceDisPlayName { get; set; }
        public string ServiceDescription { get; set; }
        public string FileName { get; set; }
        public string Path { get; set; }

        public ServiceStatus Status { get; set; }

        public string FullPath
        {
            get
            {
                return this.Path +"\\"+ this.FileName;
            }
        }
    }
}
